package com.youdianda.controller;


import com.youdianda.dto.UserLoginDTO;
import com.youdianda.result.Result;
import com.youdianda.service.IYddUserService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/index")
@Slf4j
@Api(tags = "基础模块")
public class YddUserController {

    @Autowired
    private IYddUserService iYddUserService;

    /**
     * 登录
     * @param dto
     * @return
     */
    @PostMapping("/login")
    public Result login(@RequestBody UserLoginDTO dto){
        return iYddUserService.login(dto);
    }

    /**
     * 获取用户资料
     * @return
     */
    @PostMapping("/profile")
  public Result getUserData(){
        return iYddUserService.getUserData();
  }



}
